package com.cf.studiomanage.service.impl;

import com.cf.studiomanage.entity.ClubApplication;
import com.cf.studiomanage.mapper.ClubApplicationMapper;
import com.cf.studiomanage.service.ClubApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClubApplicationServiceImpl implements ClubApplicationService {

    @Autowired
    private ClubApplicationMapper mapper;

    @Override
    public boolean submitApplication(ClubApplication application) {
        return mapper.submitApplication(application) > 0;
    }

    @Override
    public List<ClubApplication> getUserApplications(Long userId) {
        return mapper.getUserApplications(userId);
    }

    @Override
    public List<ClubApplication> getAllApplications() {
        return mapper.getAllApplications();
    }

    @Override
    public boolean reviewApplication(Long id, String status) {
        return mapper.updateStatus(id, status) > 0;
    }
}
